<?php
header("Content-Type: text/plain;charset=utf-8");
header("Access-Control-Allow-Origin:*");
header("Access-Control-Methods:POST,GET");
require_once('../../com/dao/suggDao.php');

$content = $_POST['content']; //建言内容
//echo $content;
$propic = $_POST['propic']; //头像
//echo $propic;
$data = date("Y-m-d H:i:s"); //建言时间

//实例化SuggDao类
$suggDao = new SuggDao();
if( $suggDao->insert($content,$propic,$data)){
    $result = array('key'=>'success');
}else{
    $result = array('key'=>'error');
}

echo json_encode($result,JSON_UNESCAPED_UNICODE);

